For example, in an optical lever type of scanning probe microscope, a probe of a cantilever is caused to move along a surface of a sample such that bending of the cantilever is detected, and thereby it is possible to obtain a surface image (unevenness image) of the sample (for example, see Patent Literature 1 to be described below). This type of scanning probe microscope includes an optical irradiation unit that irradiates the cantilever with a light beam and an optical detection unit that receives a reflected beam from the cantilever.
In a case where the sample is not horizontally placed, a surface, which should be horizontal in a proper posture, is inclined, and variations in luminance based on such inclination appear on the surface image of the sample. Therefore, a problem arises in that an accurate surface image is not obtained. In this respect, some scanning probe microscopes have a function of performing inclination correction on the surface image of the sample. For example, in the inclination correction, luminance of pixels (for example, pixels of one line) of the surface image of the surface, which should be horizontal at the proper posture, is extracted, and an image process is performed on the surface image of the sample by using a mean value, a median value, or the like of values of the luminance of the pixels.
FIG. 6 is a perspective view illustrating an example of a sample 100, which is an observation target, and illustrates only a part of the sample 100. A surface of the sample 100 is provided with a plurality of convex portions 101 extending in a straight line, the convex portions being formed side by side in parallel, with concave portions 102 interposed therebetween. For example, in a case where a semiconductor component is observed as the sample, the sample 100 having a surface shape as illustrated in FIG. 6 becomes an observation target in some cases.
In a case where inclination correction is performed on a surface image of the sample 100, for example, it is possible to extract luminance of pixels of the surface image corresponding to the concave portions 102 along a straight line 103 parallel to the convex portion 101 and to perform inclination correction based on a mean value, a median value, or the like of the luminance of the pixels.    [Patent Literature 1] JP-A-2014-211372